package com.liushao.service;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @program: untitled1
 * @ClassName MQService
 * @description:
 * @author: 陈修华
 * @create: 2025−01-22 10:08
 * @Version 1.0
 **/
@Service
public class MQService {
    @Autowired
    private AmqpTemplate amqpTemplate;


    public boolean sendMessage(String exchange,String routingKey,Object message){
        System.out.println("发送消息了.....");
        amqpTemplate.convertAndSend(exchange,routingKey,message);
        return true;
    }
}
